#
# $Id: Makefile.all,v 1.3 2005/07/29 20:58:04 gray Exp $
#

HFLS	= md5.h
OBJS	= md5.o

CC	= cc
CFLAGS	= -g -I. -O2
LDFLAGS	=
RANLIB	= ranlib

DESTDIR	= /usr/local
TEST	= md5_t
LIBRARY	= libmd5.a

all : $(LIBRARY)

clean :
	rm -f a.out core *.o *.t *.cpp
	rm -f $(LIBRARY) $(TEST)

install : $(HFLS) $(LIBRARY)
	install -c -m 444 $(HFLS) $(DESTDIR)/include
	install -c -m 444 $(LIBRARY) $(DESTDIR)/lib
	$(RANLIB) $(DESTDIR)/libo/$(LIBRARY)

$(LIBRARY) : $(OBJS)
	ar cr $(LIBRARY) $?
	$(RANLIB) $@

tests : $(TEST)

$(TEST) : $(TEST).o $(LIBRARY)
	rm -f $@
	$(CC) $(LDFLAGS) $(TEST).o $(LIBRARY)
	mv a.out $@

.c.o :
	rm -f $@
	$(CC) $(CFLAGS) -c $< -o ./$@

#
# Below are dependencies that are automatically generated by make
# depend.  Please do not edit by hand.
#

md5.o: md5.c md5.h md5_loc.h
md5_t.o: md5_t.c md5.h
